﻿using System.Transactions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SweetSurvey.Tests.RepositoryTests
{
    [TestClass]
    public class RepositoryTestBase : TestBase
    {
        protected TransactionScope scope;

        //Use TestInitialize to run code before running each test
        [TestInitialize]
        public virtual void MyTestInitialize()
        {
            // start a new transaction
            scope = new TransactionScope(TransactionScopeOption.Required);
        }
        
        //Use TestCleanup to run code after each test has run
        [TestCleanup]
        public virtual void MyTestCleanup()
        {
            // rollback this transaction
            scope.Dispose();
        }
    }
}
